<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>文档管理</title>
<link rel="stylesheet" type="text/css" href="../img/base.css">
<script language="javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
</head>
<body leftmargin="8" topmargin="8" background='../img/allbg.gif'>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" align="center">
            <tr>
		<td align='center' valign='top'>  
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr bgcolor="#FFFFFF">
                             <td height="4"></td>
                           </tr>
                    </table>
                
                     <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA">
                          <tr>
                               <td height="26" background="../img/tbg.gif">
                                  <form action="" method="post">
                                        <table width="98%" border="0" cellspacing="2" cellpadding="0">
                                                <tr>
                                                      <td  colspan="4" align="left">&nbsp;
                                                          产品名称：<input type='text' name='product_name' id="news_name" value="<{$product_name}>" />&nbsp;
														  产品状态：<select name=status>
																		<option <{if $status eq 0}>selected="selected"<{/if}> value='0'>未付款</option>																		
																		<option <{if $status eq 1}>selected="selected"<{/if}> value='1'>预约</option>
																		<option <{if $status eq 2}>selected="selected"<{/if}> value='2'>预定</option>
																		<option <{if $status eq 3}>selected="selected"<{/if}> value='3'>已付款</option
																		<option <{if $status eq 4}>selected="selected"<{/if}> value='4'>已取消</option>
																	</select>&nbsp;
														 客户手机：<input type='text' name='phone' id="news_name" value="<{$phone}>" />&nbsp;
														 开始时间：<input type='text' onclick="WdatePicker()"  name='start_time' id="news_name" value="<{$start_time|date_format:"%Y-%m-%d %H:%M"}>" />&nbsp;
														 结束时间：<input type='text' onclick="WdatePicker()"  name='end_time' id="news_name" value="<{$end_time|date_format:"%Y-%m-%d %H:%M"}>" />&nbsp;
                                                                 <input type="hidden" name="op" value="search" />
                                                                 <input type='submit' class="coolbg np" value='搜索' />
                                                      </td>
                                               </tr> 
                                        </table>
                                    </form>
                              </td>
                         </tr>
                     </table>
            
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr bgcolor="#FFFFFF">
                            <td height="4"></td>
                        </tr>
                    </table>

                    <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA">
                        <tr bgcolor="#E7E7E7">
                            <td height="24" align="left" colspan="13" background="../img/tbg.gif">
                                §订单 &gt; 订单管理&nbsp;
                            </td>
                        </tr>
                        <tr align="center" bgcolor="#FAFAF1" height="22">
                            <td width="3%">ID</td>
							<td width="5%">城市</td>
							<td width="8%">产品名称</td>
                            <td width="3%">单价</td>
							<td width="3%">数量</td>
							<td width="3%">总价</td>
							<td width="5%">状态</td>
							<td width="5%">客户姓名</td>
							<td width="8%">客户手机</td>
							<td width="8%">开始时间</td>
							<td width="8%">结束时间</td>
							<td width="8%">下订单时间</td>
                            <td width="10%">操作</td>
                        </tr>
                        <{foreach item=list from=$orderlist}>
                            <tr align='center' bgcolor="#FFFFFF"  onMouseMove="javascript:this.bgColor='#f4fbf4';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
                                 <td align='left'>&nbsp;&nbsp;<{$list.order_id}></td>
								 <td align='left'>&nbsp;&nbsp;<{$list.product_city_name}></td>
                                 <td align='left'>&nbsp;&nbsp;<{$list.product_name}></td>
								 <td align='left'>&nbsp;&nbsp;<{$list.product_price}></td>
                                 <td align='left'>&nbsp;&nbsp;<{$list.count}></td>
								 
								  <td align='left'>&nbsp;&nbsp;<{$list.order_sum_price}></td>
								  <{if $list.order_status eq 0}>
									<td align='left'>&nbsp;&nbsp;未付款</td>
								 <{else if $list.order_status eq 1}>
									<td align='left'>&nbsp;&nbsp;预定</td>
								 <{else if $list.order_status eq 2}>
									<td align='left'>&nbsp;&nbsp;预约</td>
								 <{else if $list.order_status eq 3}>
									<td align='left'>&nbsp;&nbsp;已付款</td>
								<{else if $list.order_status eq 4}>
									<td align='left'>&nbsp;&nbsp;已取消</td>
								 <{/if}>
                                 <td align='left'>&nbsp;&nbsp;<{$list.user_name}></td>
								  <td align='left'>&nbsp;&nbsp;<{$list.user_phone}></td>
								 <td align='left'>&nbsp;&nbsp;<{$list.start_time|date_format:"%Y-%m-%d %H:%M"}></td>
                                 <td align='left'>&nbsp;&nbsp;<{$list.end_time|date_format:"%Y-%m-%d %H:%M"}></td>
                                <td align='left'>&nbsp;&nbsp;<{$list.order_addtime|date_format:"%Y-%m-%d %H:%M"}></td>
                                <td>
									<a href="order_info.php?act=getinfo&order_id=<{$list.order_id}>">查看订单</a> |
									<a href="javascript:update_status(<{$list.order_id}>,0)">未付款</a> |
									<a href="javascript:update_status(<{$list.order_id}>,1)">预定</a> |
									<a href="javascript:update_status(<{$list.order_id}>,2)">预约</a> |
									<a href="javascript:update_status(<{$list.order_id}>,3)">已付款</a> |
									<a href="javascript:update_status(<{$list.order_id}>,4)">取消</a>
                                </td>
                            </tr>
                        <{/foreach}>                
                        <tr bgcolor="#FAFAF1">
                            <td height="24" colspan="13">&nbsp;&nbsp;<{$page_str}></td>
                        </tr>
                    </table>

                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="4"></td>
                        </tr>
                        <tr bgcolor="#FFFFFF">
                                <td height="26"></td>
                        </tr>
                        <tr>
                                <td colspan="2" height="4"></td>
                        </tr>
                    </table>
                </td>
            </tr>
     </table>
</body>
</html>
<script>
function update_status(order_id, status)
{
	if(order_id == 0)
	{
		alert("请选择订单！");
		return false;
	}
	if (confirm("是否更改订单状态？\n\n确定->是\n\n取消->不是"))
	{
		location = "order_act.php?action=updatdstatus&order_id="+order_id+"&status="+status;
	}
}
</script>